package com.example.shop.user.dao;

import com.example.shop.user.dto.UserBriefInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserBriefInfoDao {
    @Results(id = "UserBriefInfoResultMap",value = {
            @Result(column = "user_id",property = "id"),
            @Result(column = "user_avatar",property = "avatar"),
            @Result(column = "user_name",property = "name"),
    })
    @Select("select user_id,user_avatar,user_name from `user` where user_id = ${userId}")
    UserBriefInfo selectById(Long userId);
}
